<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>修改信息</title>
<%@ include file="/web/header.jsp"%>
</head>
<body>
<fieldset class="layui-elem-field">
 <legend>项目修改</legend>
 <div class="layui-field-box">
	<form class="layui-form layui-form-pane" lay-filter="formA">
	 <div class="layui-form-item">
	  <label class="layui-input-label">员工编号
	  </label>
	  <div class="layui-input-inline">
	   <input type="text" name="code" required readonly lay-verify="required"
	   	placeholder="请输入员工编号" autocomplete="off" class="layui-input"onclick="confirm()">
	  </div>
	 </div>
	 <div class="layui-form-item">
	  <label class="layui-input-label">项目名
	  </label>
	  <div class="layui-input-inline">
	   <input type="text" name="name" required lay-verify="required"
	   	placeholder="请输入项目名称" autocomplete="off" class="layui-input">
	  </div>
	 </div>
	 <div class="layui-form-item">
	  <label class="layui-input-label">开始时间
	  </label>
	  <div class="layui-input-inline">
	   <input type="text" name="stTime" required lay-verify="required"
	   	placeholder="请输入开始时间" autocomplete="off" class="layui-input">
	  </div>
	 </div>
	 <div class="layui-form-item">
	  <label class="layui-input-label">结束时间
	  </label>
	  <div class="layui-input-inline">
	   <input type="text" name="endTime" required lay-verify="required"
	   	placeholder="请输入结束时间" autocomplete="off" class="layui-input">
	  </div>
	 </div>
	 <div class="layui-form-item">
	  <div class="layui-input-inline">
	 	<input type="button" value='确定' class="layui-btn"lay-submit lay-filter="upd">
	 	<input type="reset" value='重置' class="layui-btn layui-btn-primary">
	  <input type="button" value='关闭' class="layui-btn" onclick="layerClose()">
	  </div>
	 </div>
	 <input type="hidden" name="action" value="upd">
	</form>
</div>
</fieldset>
<script type="text/javascript">
var code ='<%=request.getParameter("code") %>';
// layer.msg(code)
function init(){
	ajax("/ProjectServlet",{code:code,action:'get'},'json',function(data){
// 		$("input[name='code']").val(data.code)
// 		$("input[name='name']").val(data.name)
// 		$("input[name='tel']").val(data.tel)
	//	form.val('formA',{code:data.code,name:data.name,tel:data.tel});
		form.val('formA',data);	
	});
}
function confirm(){
	layer.msg("编号不可修改！")
}
init();
formOnSubmit('upd','/ProjectServlet','text',function(data){
	if(data==1){
		layer.msg("修改成功",layerClose)
	}else{
		layer.msg("修改失败")
	}	
})
</script>
</body>
</html>